﻿using Application.CFSKService;
using Application.CFTKService;
using Application.CMKService;
using Application.CPCService;
using Application.EIService;
using Application.EMRService;
using Application.ERService;
using Application.SSDService;
using AppService.CFFKService;
using AppService.CM2Service;
using AppService.CMService;
using AutoMapper;
using Domain.Entity;
using Microsoft.AspNetCore.Mvc;

namespace UI7_2.Controllers
{
	public class ERController : Controller
	{
		private readonly IMapper mapper;
		private readonly ILogger<HomeController> _logger;
		private readonly ICFFKService icffkService;
		private readonly ICFSKService icfskService;
		private readonly ICFTKService icftkService;

		private readonly ICMKService icmkService;
		private readonly ICMService icmService;
		private readonly ICM2Service icm2Service;
		private readonly ICPCService icpcService;
		private readonly ISSDService issdService;
		private readonly IEMRService eMRService;
		private readonly IERService eRService;

		public ERController(ILogger<HomeController> logger, ICFFKService icffkService, ICFSKService icfskService, IMapper mapper, ICFTKService icftkService, ICMKService icmkService, ICMService icmService, ICM2Service icm2Service, ICPCService icpcService, ISSDService issdService, IEMRService eMRService, IERService eRService)
		{
			_logger = logger;
			this.icffkService = icffkService;
			this.icfskService = icfskService;
			this.mapper = mapper;
			this.icftkService = icftkService;
			this.icmkService = icmkService;
			this.icmService = icmService;
			this.icm2Service = icm2Service;
			this.icpcService = icpcService;
			this.issdService = issdService;
			this.eMRService = eMRService;
			this.eRService = eRService;
		}
		#region 简历登记
		public IActionResult ER()
		{
			return View();
		}
		//修改录用申请
		public Task<bool> UpdateLuyong(ERDto eRDto)
		{
			return eRService.UpdateERLuyong(eRDto);
		}

		//简历表对的面试状态修改
		public Task<bool> UpdateMianshi(ERDto eRDto)
		{
			return eRService.UpdateERMianshi(eRDto);
		}
		//修改推荐人信息
		public Task<bool> UpdateERTuijians(ERDto eR)
		{
			return eRService.UpdateERTuijian(eR);
		}
		
		//添加
		public async Task<bool> AddER(ERDto eR)
		{
			return await eRService.AddER(eR);
		}
		//查全部
		public List<ER> SelectER()
		{
			return eRService.GetER();
		}
		//查有效简历
		public List<ER> GetERName(string name)
		{
			return eRService.GetERName(name);
		}
		//多条件查询全部
		public List<ER> SelectTiaojian(string? humanName, string? hunmaMajorName, string? humanMajorKindName, DateTime? startDate, DateTime? endDate)
		{
			return eRService.GetERTiaoJ(humanName, hunmaMajorName, humanMajorKindName, startDate, endDate);
		}
		//多条件查有效招聘简历
		public List<ER> SelectYouxiaoTiaojian(string? passPassComment, string? humanName, string? hunmaMajorName, string? humanMajorKindName, DateTime? startDate, DateTime? endDate)
		{
			return eRService.GetERYouxiaoJianl(passPassComment, humanName, hunmaMajorName, humanMajorKindName, startDate, endDate);
		}
		//查对应id的值
		public List<ER> SelectERId(int id)
		{
			return eRService.GetAllERId(id);
		}
		#endregion
		
		//录用申请
		public IActionResult ERSQ()
		{
			return View();
		}
		//简历筛选
		public IActionResult ERSX()
		{
			return View();
		}
		//修改复核状态
		public async Task<bool> UpdateER(ERDto eRDto)
		{
			return await eRService.UpdateER(eRDto);
		}
		public Task<bool> DeleteER(int id)
		{
			return eRService.DeleteER(id);
		}
		public IActionResult ERSP()
		{
			return View();
		}
		public IActionResult ERCX()
		{
			return View();
		}
	}
}

